<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="middle padtop10 myclear">
	<div class="page-content">
		
		<!-- bread crumb -->
		<p id="bread-crumb">
			<a href="<?php echo base_url();?>">
				<?php echo $lang['home'];?>
			</a>
			<a href="<?php echo site_url('monitor/adsOnlineMonitoring');?>">
				<?php echo $lang['online_ads_monitoring'];?>
			</a>
			<?php echo $lang['online_user_zone_numday_monioring'];?>
		</p>
		<!-- end bread crumb -->
		<h3>
			<?php echo $lang['online_user_zone_numday_monioring'];?>
		</h3>
		<br>
		<form name="frmZone" action="<?php echo site_url('monitor/userZoneNumdayMonitoring/');?>" method="get">
			<p>
				zoneID: <input type="text" name="zoneid" size="30" value="<?php echo ($zoneid > 0 ? $zoneid : '');?>" />
				<input type="submit" value="Report" />
			</p>
			<?php if(isset($items)){?>
			<br>
			<div>
				<p class="text-right">
					Tài khoản: <input type="text" name="user" size="25" value="<?php echo $user;?>" />
				</p>
				<table cellpadding="0" cellspacing="0" width="100%" border="1" class="martop10 tbl-list tablesorter">
				<thead>
					<tr>
						<th class="td-label text-center"><strong>STT</strong></th>
						<th class="td-label"><strong>ID</strong></th>
						<th class="td-label"><strong>Tài khoản</strong></th>
						<th class="td-label"><strong>Nhóm</strong></th>
						<th class="td-label"><strong>Kiểu</strong></th>
						<th class="td-label"><strong>Tên Zone</strong></th>
						<th class="td-label"><strong>Vùng miền</strong></th>
						<th class="td-label text-right"><strong>Số ngày</strong></th>
					</tr>
				</thead>
				<tbody>
					<?php $j = 1; if(count($items) > 0) foreach ($items as $item){?>
					<tr>
						<td class="text-center">
							<?php echo ($j);?>
						</td>
						<td>
							<?php echo $item->user_id;?>
						</td>
						<td>
							<?php echo $item->username;?>
						</td>
						<td>
							<?php echo $item->groupname;?>
						</td>
						<td>
							<?php echo ($item->typegroup == 1 ? 'Nội bộ' : 'Khách hàng');?>
						</td>
						<td>
							<?php echo $item->zonename;?>
						</td>
						<td>
							<?php echo $common_lang['arr_location'][(int)$item->location];?>
						</td>
						<td class="text-right">
							<?php echo number_format($item->num);?>
						</td>
					</tr>
					<?php $j++;}	//end for?>
				</tbody>
				<tfoot>
					<tr>
						<td class="td-label text-right" colspan="8">
							&nbsp;
						</td>
					</tr>
				</tfoot>
			</table>
			</div>
			<?php } else echo '<br>Not found data';?>
		</div>
	</form>
</div>
<br><br>
<script type="text/javascript">
$(document).ready(function(){
	$('.tablesorter').tablesorter({textExtraction: function(node){
		var val = node.innerHTML;
		val = val.replace(/,/g, '');
		return val;
	},
		sortList: [[0,0]],
		sortMultiSortKey: 'ctrlKey',
		headers: {
			3: {sorter: false},
			4: {sorter: false},
			5: {sorter: false},
			6: {sorter: false}
		}
	});
});
</script>